package com.atguigu.springcloud;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;

/**
 * @PROJECT_NAME: cloud2020
 * @DESCRIPTION:
 * @Author: csc
 * @DATE: 2023/3/29 8:23
 */
@EnableBinding(Sink.class)
public class ReceiveMessageListenerController {

    @Value("${server.port}")
    private String serverPost;

    @StreamListener(Sink.INPUT)
    public void input(Message<String> message){
        System.out.println("消费者一号,---->接收到的消息"+message.getPayload()+"\t\n port: "+serverPost);
    }


}
